<?php
class Modules_Global_App extends ME_DAL_FileCacheModule
{
	
	protected $_depend = array();

	/**
	* 过期时间
	* @var integer
	*/
	protected $_expire = 3600;

    private $db;
    private function loadDb()
    {
        $this->db = Db_Admin::instance();
    }
	
	public function refresh(array $param = array())
	{
        
        $this->loadDb();
        
        $param = array(
                'db'          => $this->db,
                'fromSql'     => " from global_app ", #from部分的语句
                'orderBySql'  => ' order by id desc ',
                'pagesize'    => 100,
                'page'        => 1,
                'onlyData'    => true,
        );

        $listData = Libs_DBHelper::getList($param);
        $cacheData = array();
        if($listData){
            foreach($listData as $d){
                $cacheData[$d['id']] = $d;
            }
        }

		$this->set(array(),$cacheData);
		return true;
	}
}